var o = getApp(), t = !0;

Page({
    data: {
        status: !1
    },
    onLoad: function(o) {
        if (o.scene) {
            var t = decodeURIComponent(o.scene);
            if (console.log(t), t) {
                var e = [];
                e = t.split(",");
                for (var n = 0; n < e.length; n++) {
                    var s;
                    s = e[n].split("="), console.log("59", s), "store_id" == s[0] ? this.setData({
                        store_id: s[1]
                    }) : "hold_id" == s[0] && this.setData({
                        hold_id: s[1]
                    });
                }
            }
        }
        this.getstore();
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    getstore: function() {
        wx.showLoading({
            title: "核销中"
        });
        var t = this, e = o.getNetAddresss("plugin.store-card.Frontend.Modules.Verifier.Controllers.audit.page");
        o._postNetWork({
            url: e,
            data: {
                hold_id: t.data.hold_id,
                store_id: t.data.store_id
            },
            success: function(o) {
                var e = o.data;
                wx.hideLoading({
                    success: function(o) {}
                }), 1 == e.result ? t.setData({
                    cardUse: e.data
                }) : wx.showToast({
                    title: e.msg,
                    duration: 1e3,
                    icon: "none"
                });
            },
            fail: function(o) {
                console.log(o.msg);
            }
        });
    },
    getdata: function() {
        console.log(t);
        var e = this;
        1 == t && (console.log(t), wx.showModal({
            title: "是否进行核销",
            confirmText: "确认核销",
            showCancel: !0,
            cancelTextL: "取消",
            success: function(n) {
                if (console.log(n), n.confirm) {
                    t = !1, wx.showLoading({
                        title: "核销中"
                    });
                    var s = o.getNetAddresss("plugin.store-card.Frontend.Modules.Verifier.Controllers.audit.index");
                    o._postNetWork({
                        url: s,
                        data: {
                            hold_id: e.data.hold_id,
                            store_id: e.data.store_id
                        },
                        success: function(o) {
                            var n = o.data;
                            wx.hideLoading({
                                success: function(o) {}
                            }), 1 == n.result ? (e.setData({
                                status: !0
                            }), wx.showToast({
                                title: "核销成功",
                                icon: "none",
                                duration: 1e3
                            })) : (t = !0, wx.showToast({
                                title: n.msg,
                                duration: 1e3,
                                icon: "none"
                            }));
                        },
                        fail: function(o) {
                            console.log(o.msg);
                        }
                    });
                }
            },
            fail: function(o) {
                console.log(o);
            }
        }));
    }
});